<?php 
	echo $html->css( 'jquery-ui-1.8.16.custom.css' );
	echo $html->css( 'visualize.css' );
	echo $html->css( 'visualize-dark.css' );
	$javascript->link( array( 'jquery/jquery-1-6-4', 'jquery/jquery-ui-1.8.16.custom.min', 'jquery/charting/js/visualize.jQuery', 'projects/index' ), false );
?>

<h1>Mis Tareas</h1>

<div style="width:740px;" id="listTeams" class="floatL" >
	<?php foreach( $listCategory['Task'] as $listTask ) : ?>
		<div class="project">
			<?php echo $html->link( 'x', array( 'action' => 'deleteTask', $listTask['id'] ), array( 'class' => 'deleteSchedule' ), null, null, 'Estas seguro de que deseas eliminar esta carpeta ?' ) ?>
			<?php echo $html->image( 'task.png' ); ?>
			<p><b><?php echo $html->link( $listTask['name'], '#', array( 'title' => $listTask['description'] ) ); ?></b></p>
			<p>Progreso: <select  class="progress" task_id="<?php echo $listTask['id'] ?>"><?php foreach( $listProgress as $intProgress ) :  ?><option <?php if($listTask['progress'] == $intProgress) echo 'selected ' ?> value="<?php echo $intProgress ?>"><?php echo $intProgress ?>%</option><?php endforeach; ?></select></p>
		</div>
	<?php endforeach; ?>

	<div class="clear"></div>
</div>


<div class="tableChart floatR">
	<table style="display:none;" >
		<caption>Distribucion de Horarios</caption>
		<thead>
			<tr>
				<td></td>
				<th scope="col"></th>
			</tr>
		</thead>
		<tbody>
			<?php foreach($listCategory['Task']  as $listTask ) : ?>
				<tr>
					<th scope="row"><?php echo $listTask['name'] ?> <p class="taskDate">Fecha de incio: <?php echo $listTask['TasksSchedule']['date'] . ' Hora: ' . $listTask['TasksSchedule']['start_hour'] . ':00 - ' . $listTask['TasksSchedule']['end_hour'] . ':00'  ?> </p></th>
					<td><?php echo $listTask['estimated_hours'] ?></td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
</div>

<div class="clear"></div>

<a href="#" id="showAddTaskDialog" >Nueva Tarea</a>


<div style="display:none;" id="addTaskDialog" title="Nueva Tarea">
	<?php
		echo $form -> create('Category', array( 'action' => 'addTask' ));
		echo $form -> input('Task.name', array( 'label' => 'Nombre' ) );
		echo $form -> input('Task.description', array( 'label' => 'Descripcion' ) );
		echo $form -> label('Task.difficulty', 'Nivel de Dificultad' );
		echo $form -> select('Task.difficulty', $listDifficulties, 'DIFICIL', array( 'empty' => false ));
		echo $form->input( 'Task.end_date', array( 'type' => 'text', 'label' => 'Fecha de Entrega', 'id' => 'taskEndDate' ) );
		echo $form->input( 'Task.estimated_hours', array( 'style' => 'width: 20px;', 'length' => 2 ) );
		echo $form -> input('Category.id', array( 'type' => 'hidden', 'value' => $listCategory['Category']['id'] ) );
		echo $form -> end('Salvar');
	?>
</div>